import { ResponseModel, ResponseStructure } from '@/model/responseModel';
import { RequestServiceProxy } from '@/utils/request';
import { AccounttypeModel, MealtypeModel, AccountModel, DeviceModel, DetailsModel, CompilationModel, RestauranteModel } from './data';


const _request = new RequestServiceProxy();

// 获取账户类别分页列表
export async function getAccounttypeList(
  param?: AccounttypeModel.accounttypeRequest,
): Promise<ResponseStructure<ResponseModel<AccounttypeModel.accounttypeResponse>>> {
  return await _request.post('/pos/accounttype/page', param);
}

//账户类别查询
export async function queryAccounttype(
  param: AccounttypeModel.accounttypeRequest,
): Promise<ResponseStructure<AccounttypeModel.accounttypeResponse>> {
  return await _request.post<ResponseStructure<AccounttypeModel.accounttypeResponse>>(
    '/pos/accounttype/query',
    param,
  );
}

//新增账户类别
export async function createAccounttype(
  param: AccounttypeModel.accounttypeResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/pos/accounttype/create', param);
}

//修改账户类别
export async function updateAccounttype(
  param: AccounttypeModel.accounttypeResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/pos/accounttype/update', param);
}

//删除账户类别
export async function deleteAccounttype(
  param: AccounttypeModel.deleteAccounttypeModel,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/pos/accounttype/delete', param);
}

// 获取餐别分页列表
export async function getMealtypeList(
  param?: MealtypeModel.mealtypeRequest,
): Promise<ResponseStructure<ResponseModel<MealtypeModel.mealtypeResponse>>> {
  return await _request.post('/pos/mealtype/page', param);
}

//餐别查询
export async function queryMealtype(
  param: MealtypeModel.mealtypeRequest,
): Promise<ResponseStructure<MealtypeModel.mealtypeResponse>> {
  return await _request.post<ResponseStructure<MealtypeModel.mealtypeResponse>>(
    '/pos/mealtype/query',
    param,
  );
}

//新增餐别
export async function createMealtype(
  param: MealtypeModel.mealtypeResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/pos/mealtype/create', param);
}

//修改餐别
export async function updateMealtype(
  param: MealtypeModel.mealtypeResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/pos/mealtype/update', param);
}

//删除餐别
export async function deleteMealtype(
  param: MealtypeModel.deleteMealtypeModel,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/pos/mealtype/delete', param);
}

// 获取餐厅分页列表
export async function getRestaurantList(
  param?: RestauranteModel.restaurantRequest,
): Promise<ResponseStructure<ResponseModel<RestauranteModel.restaurantResponse>>> {
  return await _request.post('/pos/restaurant/page', param);
}

//餐厅查询
export async function queryRestaurant(
  param: RestauranteModel.restaurantRequest,
): Promise<ResponseStructure<RestauranteModel.restaurantResponse>> {
  return await _request.post<ResponseStructure<RestauranteModel.restaurantResponse>>(
    '/pos/restaurant/query',
    param,
  );
}

//新增餐厅
export async function createRestaurant(
  param: RestauranteModel.restaurantResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/pos/restaurant/create', param);
}

//修改餐厅
export async function updateRestaurant(
  param: RestauranteModel.restaurantResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/pos/restaurant/update', param);
}

//删除餐厅
export async function deleteRestaurant(
  param: RestauranteModel.deleteRestauranteModel,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/pos/restaurant/delete', param);
}

// 获取账户分页列表
export async function getAccountList(
  param?: AccountModel.accountRequest,
): Promise<ResponseStructure<ResponseModel<AccountModel.accountResponse>>> {
  return await _request.post('/pos/account/page', param);
}

//账户查询
export async function queryAccount(
  param: AccountModel.accountRequest,
): Promise<ResponseStructure<AccountModel.accountResponse>> {
  return await _request.post<ResponseStructure<AccountModel.accountResponse>>(
    '/pos/account/query',
    param,
  );
}

//新增账户
export async function createAccount(
  param: AccountModel.accountResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/pos/account/create', param);
}

//修改账户
export async function updateAccount(
  param: AccountModel.accountResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/pos/account/update', param);
}

//删除账户
export async function deleteAccount(
  param: AccountModel.deleteAccountModel,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/pos/account/delete', param);
}

// 获取设备分页列表
export async function getDeviceList(
  param?: DeviceModel.deviceRequest,
): Promise<ResponseStructure<ResponseModel<DeviceModel.deviceResponse>>> {
  return await _request.post('/pos/device/page', param);
}

//设备查询
export async function queryDevice(
  param: DeviceModel.deviceRequest,
): Promise<ResponseStructure<DeviceModel.deviceResponse>> {
  return await _request.post<ResponseStructure<DeviceModel.deviceResponse>>(
    '/pos/device/query',
    param,
  );
}

//新增设备
export async function createDevice(
  param: DeviceModel.deviceResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/pos/device/create', param);
}

//修改设备
export async function updateDevice(
  param: DeviceModel.deviceResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/pos/device/update', param);
}

//删除设备
export async function deleteDevice(
  param: DeviceModel.deleteDeviceModel,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/pos/device/delete', param);
}

// 获取明细分页列表
export async function getDetailsList(
  param?: DetailsModel.detailsRequest,
): Promise<ResponseStructure<ResponseModel<DetailsModel.detailsResponse>>> {
  return await _request.post('/pos/details/page', param);
}

//明细查询
export async function queryDetails(
  param: DetailsModel.detailsRequest,
): Promise<ResponseStructure<DetailsModel.detailsResponse>> {
  return await _request.post<ResponseStructure<DetailsModel.detailsResponse>>(
    '/pos/details/query',
    param,
  );
}

//新增明细
export async function createDetails(
  param: DetailsModel.detailsResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/pos/details/create', param);
}

//修改明细
export async function updateDetails(
  param: DetailsModel.detailsResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/pos/details/update', param);
}

//删除明细
export async function deleteDetails(
  param: DetailsModel.deleteDetailsModel,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/pos/details/delete', param);
}

// 获取汇总分页列表
export async function getCompilationList(
  param?: CompilationModel.compilationRequest,
): Promise<ResponseStructure<ResponseModel<CompilationModel.compilationResponse>>> {
  return await _request.post('/pos/compilation/page', param);
}

//汇总查询
export async function queryCompilation(
  param: CompilationModel.compilationRequest,
): Promise<ResponseStructure<CompilationModel.compilationResponse>> {
  return await _request.post<ResponseStructure<CompilationModel.compilationResponse>>(
    '/pos/compilation/query',
    param,
  );
}

//新增汇总
export async function createCompilation(
  param: CompilationModel.compilationResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/pos/compilation/create', param);
}

//修改汇总
export async function updateCompilation(
  param: CompilationModel.compilationResponse,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/pos/compilation/update', param);
}

//删除汇总
export async function deleteCompilation(
  param: CompilationModel.deleteCompilationModel,
): Promise<ResponseStructure<void>> {
  return await _request.post<ResponseStructure<void>>('/pos/compilation/delete', param);
}